home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="utf-8"?> <html><head><title>Hex Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03080801"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css"> p.P1{ } span.T1{ font-weight:bold;} </style></head><body> <help:paragraphinfo state="E" xmlns:help="http://openoffice.org/2000/help"/><help:to-be-embedded Eid="hex" xmlns:help="http://openoffice.org/2000/help"> <p class="Head1"><help:paragraphinfo state="U" number="1"/><help:key-word value="Hex; function" tag="kw66486_1"/><help:link Id="66486">Hex Function [Runtime]</help:link></p> <p class="Paragraph"><help:paragraphinfo state="U" number="2"/>Returns a string that represents the hexadecimal value of a number.</p> <help:paragraphinfo state="E"/></help:to-be-embedded> <p class="Head2"><help:paragraphinfo state="U" number="3" xmlns:help="http://openoffice.org/2000/help"/>Syntax:</p> <p class="Paragraph"><help:paragraphinfo state="U" number="4" xmlns:help="http://openoffice.org/2000/help"/>Hex (Number)</p> <p class="Head2"><help:paragraphinfo state="U" number="5" xmlns:help="http://openoffice.org/2000/help"/>Return value:</p> <p class="Paragraph"><help:paragraphinfo state="U" number="6" xmlns:help="http://openoffice.org/2000/help"/>String</p> <p class="Head2"><help:paragraphinfo state="U" number="7" xmlns:help="http://openoffice.org/2000/help"/>Parameters:</p> <p class="Paragraph"><help:paragraphinfo state="U" number="8" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Number:</span> Any numeric expression that you want to convert to a hexadecimal number.</p> <p class="Paragraph"><help:paragraphinfo state="S" xmlns:help="http://openoffice.org/2000/help"/><help:embedded Id="66475" Eid="errorcode" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="Paragraph"><help:paragraphinfo state="S" xmlns:help="http://openoffice.org/2000/help"/><help:embedded Id="66475" Eid="err5" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="Head2"><help:paragraphinfo state="U" number="9" xmlns:help="http://openoffice.org/2000/help"/>Example:</p> <p class="PropText"><help:paragraphinfo state="U" number="29" xmlns:help="http://openoffice.org/2000/help"/>Sub ExampleHex</p> <p class="PropText"><help:paragraphinfo state="U" number="30" xmlns:help="http://openoffice.org/2000/help"/>REM uses BasicFormulas in <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Calc</p> <p class="PropText"><help:paragraphinfo state="U" number="31" xmlns:help="http://openoffice.org/2000/help"/>Dim a2, b2, c2 as String</p> <p class="PropText"><help:paragraphinfo state="U" number="32" xmlns:help="http://openoffice.org/2000/help"/>a2 = "&H3E8"</p> <p class="PropText"><help:paragraphinfo state="U" number="33" xmlns:help="http://openoffice.org/2000/help"/>b2 = Hex2Int(a2)</p> <p class="PropText"><help:paragraphinfo state="U" number="34" xmlns:help="http://openoffice.org/2000/help"/>MsgBox b2</p> <p class="PropText"><help:paragraphinfo state="U" number="35" xmlns:help="http://openoffice.org/2000/help"/>c2 = Int2Hex(b2)</p> <p class="PropText"><help:paragraphinfo state="U" number="36" xmlns:help="http://openoffice.org/2000/help"/>MsgBox c2</p> <p class="PropText"><help:paragraphinfo state="U" number="37" xmlns:help="http://openoffice.org/2000/help"/>End Sub</p> <p class="PropText"><help:paragraphinfo state="U" number="18" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="PropText"><help:paragraphinfo state="U" number="19" xmlns:help="http://openoffice.org/2000/help"/>Function Hex2Int( sHex As String ) As Long</p> <p class="PropText"><help:paragraphinfo state="U" number="20" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>REM Returns a Long-Integer from a hexadecimal value.</p> <p class="PropText"><help:paragraphinfo state="U" number="21" xmlns:help="http://openoffice.org/2000/help"/>Hex2Int = clng( sHex )</p> <p class="PropText"><help:paragraphinfo state="U" number="22" xmlns:help="http://openoffice.org/2000/help"/>End Function</p> <p class="PropText"><help:paragraphinfo state="U" number="23" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="PropText"><help:paragraphinfo state="U" number="24" xmlns:help="http://openoffice.org/2000/help"/>Function Int2Hex( iLong As Long) As String</p> <p class="PropText"><help:paragraphinfo state="U" number="25" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>REM Calculates a hexadecimal value in Integer.</p> <p class="PropText"><help:paragraphinfo state="U" number="26" xmlns:help="http://openoffice.org/2000/help"/>Int2Hex = "&H" & Hex( iLong )</p> <p class="PropText"><help:paragraphinfo state="U" number="27" xmlns:help="http://openoffice.org/2000/help"/>End Function</p> <p class="PropText"><help:paragraphinfo state="U" number="28" xmlns:help="http://openoffice.org/2000/help"/></p> </body></html>